package com.easy.yours.biz.model;

import com.easy.system.model.BaseBean;
import org.hibernate.annotations.ForeignKey;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: sunguangzhu
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "t_student", catalog = "commonproject")
public class Student extends BaseBean implements java.io.Serializable {

    /**
     * 名称
     */
    private java.lang.String name;

    /**
     * 生日
     */
    private java.sql.Date borthDate;

    /**
     * 年龄
     */
    private java.lang.Long age;

    /**
     * 身高
     */
    private java.lang.Double height;

    /**
     * 所属班级
     */
    private com.easy.yours.biz.model.Clazz clazz;

    /**
     * default constructor
     */
    public Student() {
    }

    /**
     * full constructor
     *
     * @param name
     * @param borthDate
     * @param age
     * @param height
     * @param clazz
     */
    public Student(java.lang.String name, java.sql.Date borthDate, java.lang.Long age, java.lang.Double height, com.easy.yours.biz.model.Clazz clazz) {
        this.name = name;
        this.borthDate = borthDate;
        this.age = age;
        this.height = height;
        this.clazz = clazz;
    }

    /**
     * getter
     */
    @Column
    public java.lang.String getName() {
        return this.name;
    }

    /**
     * setter
     *
     * @param name
     */
    public void setName(java.lang.String name) {
        this.name = name;
    }

    /**
     * getter
     */
    @Column
    public java.sql.Date getBorthDate() {
        return this.borthDate;
    }

    /**
     * setter
     *
     * @param borthDate
     */
    public void setBorthDate(java.sql.Date borthDate) {
        this.borthDate = borthDate;
    }

    /**
     * getter
     */
    @Column
    public java.lang.Long getAge() {
        return this.age;
    }

    /**
     * setter
     *
     * @param age
     */
    public void setAge(java.lang.Long age) {
        this.age = age;
    }

    /**
     * getter
     */
    @Column
    public java.lang.Double getHeight() {
        return this.height;
    }

    /**
     * setter
     *
     * @param height
     */
    public void setHeight(java.lang.Double height) {
        this.height = height;
    }

    /**
     * getter
     */
    @ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
    @JoinColumn(name = "clazz_id")
    @ForeignKey(name = "fk_student_clazz")
    public com.easy.yours.biz.model.Clazz getClazz() {
        return this.clazz;
    }

    /**
     * setter
     *
     * @param clazz
     */
    public void setClazz(com.easy.yours.biz.model.Clazz clazz) {
        this.clazz = clazz;
    }

}
